import com.pojo.SomeClass;
import com.pojo.Student;
import com.service.SomeClassService;
import com.service.StudentService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class) //启动spring容器
@ContextConfiguration(locations = {"classpath:applicationContext_mapper.xml",
        "classpath:applicationContext_service.xml"})
public class test {
    @Autowired
    SomeClassService someClassService;
    @Test
    public void test1(){
//        someClassService.findAll();
//        someClassService.getCount();
        someClassService.selectFindAll(2,2);
    }
    @Test
    public void insery() throws ParseException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date date = simpleDateFormat.parse("2002-04-04");
        SomeClass someClass = new SomeClass(null,date,"19软件1",20,"我");
        int insert = someClassService.insert(someClass);
        System.out.println(insert);
    }


}
